package com.couchcrowler.shared;

import java.io.Serializable;

public class Location implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4414004886228540313L;

	private double longitude;
	
	private double latitude;
	
	public Location() {
		
	}
	
	public Location(double longitude, double latitude) {
		this.longitude = longitude;
		this.latitude = latitude;
	}

	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	@Override
	public String toString() {
		return "Location [lon=" + longitude + ", lat=" + latitude + "]";
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Location) {
			return ((Location) obj).latitude == latitude && ((Location) obj).longitude == longitude;
		}
		
		return false; 
	}

	@Override
	public int hashCode() {
		return (int) (longitude + latitude);
	}
	
}
